package pers.cj.pdos.utils;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class FileUtils {

    public static byte[] read(String filename) throws IOException {
        //读取本地文件输入流
        return read(new FileInputStream(filename));
    }

    public static byte[] read(InputStream inputStream) throws IOException {
        //byte数组用于存放字节数据
        byte[] buff = new byte[inputStream.available()];

        inputStream.read(buff);
        inputStream.close();

        return buff;
    }
}
